package com.ff.discounts.activity

import android.os.Bundle
import androidx.viewbinding.ViewBinding
import com.ff.discounts.util.ReflectUtil

/**
 *通用viewModel
 * 自动创建viewModel 以及viewModel 的通用观察处理
 * @author: fufang
 * @date: 2023/10/16
 */
open class BaseViewModelActivity<VB:ViewBinding>: com.ff.discounts.activity.BaseLogicActivity() {
    lateinit var binding:VB

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        // 调用inflate 方法， 创建viewBinding
        binding = ReflectUtil.newViewBinding(layoutInflater,javaClass)

        setContentView(binding.root)
    }
}